<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="root"></div>
<script>
    writeNumber(getPrimeArray(100));

    // 获取素数
    function getPrimeArray(max) {
        let array = [];
        for (let i = 1; i <= max; i++) {
            if (i % 7 !== 0) {
                array.push(i);
            }
        }
        return array;
    }

    // 输出数组
    function writeNumber(array, rowItem = 10, target = document.getElementById("root")) {
        for (let i = rowItem; i <= array.length + rowItem; i += rowItem) {
            let p = document.createElement("p");
            for (let j = i - rowItem; j < i; j++) {
                p.innerText += array[j] !== undefined ? array[j] + " " : "";
            }
            target.appendChild(p);
        }
    }
</script>
</body>
</html>